# $Id: PKGBUILD 86911 2013-03-24 12:00:12Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Richard Murri <admin@richardmurri.com>
# Contributor: Farhad Shahbazi <farhad@enthusiasm.cc>
# Contributor: Felix Kaiser <felix.kaiser@fxkr.net>

pkgbase=python-bottle
pkgname=("python-bottle" "python2-bottle")
pkgver=0.11.6
pkgrel=1
pkgdesc="A fast and simple micro-framework for small web-applications"
arch=(any)
url="http://bottlepy.org"
license=('MIT')
options=(!emptydirs)
makedepends=('python3' 'python2')
source=("https://github.com/defnull/bottle/archive/${pkgver}.tar.gz")

build() {
  cd "${srcdir}"
  cp -r "bottle-${pkgver}" "python2-bottle-${pkgver}"
}

package_python-bottle() {
  depends=('python3')

  cd "${srcdir}/bottle-${pkgver}"
  python3 setup.py install --root="${pkgdir}" --optimize=1
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/python-bottle/LICENSE"
}

package_python2-bottle() {
  depends=('python2')

  cd "${srcdir}/python2-bottle-${pkgver}"
  python2 setup.py install --root="${pkgdir}" --optimize=1
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/python2-bottle/LICENSE"

  # deal with conflict with python-bottle's /usr/bin/bottle.py
  mv "$pkgdir/usr/bin/bottle.py"{,2}
}
  
md5sums=('88953166fbb9b5b4718c59f2b89b205b')
